<script type="text/javascript">
$(document).ready(function(){
	$("#save").on("click",function(){
		var id = $("input[name='id']").val();	
		var name = $("input[name='name']").val();
		var password = $("input[name='password']").val();
		var sex = $('input:radio[name="sex"]:checked').val();
		var status = $('input:radio[name="status"]:checked').val();
		var realName = $("input[name='realName']").val();
		var phone = $("input[name='phone']").val();
		var companyId = $("#companyId").find("option:selected").val();
		var recom_com_id = $("#recom_com_id").find("option:selected").val();
		var address = $("input[name='address']").val();
		var email = $("input[name='email']").val();
		var IDcard = $("input[name='IDcard']").val();
		var major_id = $("#majorId").find("option:selected").val();
		var position_id = $("#position_id").find("option:selected").val();
		var degree_id = $("#degree_id").find("option:selected").val();
		
		$.post("${path}/expert/editor",{
			id : id,
			name:name,
			password:password,
			sex:sex,
			status:status,
			realName:realName,
			phone:phone,
			companyId:companyId,
			recom_com_id:recom_com_id,
			address:address,
			email:email,
			IDcard:IDcard,
			major_id:major_id,
			position_id:position_id,
			degree_id:degree_id
		},function(data){
			if(data.success){
				window.location.href = "${path}/expert/list";
			}
		})
	});
});
</script>
<div>
	<input type="hidden" name="id" value="${map.expert.id}">
	登录名：<input name="name" value="${map.expert.name}"> <br/>
	密码：<input name="password" value="${map.expert.password}"> <br/>
	姓名：<input name="realName" value="${map.expert.realName}"> <br/>
	性别：<input id="x1" type="radio" value="0" name="sex" #if($map.expert.sex ==0) checked #end/>男
		  <input id="x2" type="radio" value="1" name="sex" #if($map.expert.sex==1) checked #end/>女  <br/>
	身份证号：<input name="IDcard" value="${map.expert.IDcard}"><br/>
	邮箱：<input name="email" value="${map.expert.email}"><br/>
	现从事专业：
	<select id="majorId" name="">
	     <option value=" " >请选择</option>
	     #foreach ($major in $map.major)
	        <option value="${major.id}" #if($major.id == $map.expert.major_id)  selected="selected" #end> ${major.name}</option>
		  #end 
	</select><br/>
	工作单位：
	<select id="companyId" name="">
	     <option value=" " >请选择</option>
	     #foreach ($company in $map.company)
	        <option value="${company.id}" #if($company.id == $map.expert.companyId)  selected="selected" #end> ${company.name}</option>
		  #end 
	</select><br/>
	所在地：<input name="address" value="${map.expert.address}"><br/>
	职称：
	<select id="position_id" name="">
	     <option value=" " >请选择</option>
	     #foreach ($position in $map.position)
	        <option value="${position.id}" #if($position.id == $map.expert.position_id)  selected="selected" #end> ${position.name}</option>
		  #end 
	</select><br/>
	学历：
	<select id="degree_id" name="">
	     <option value=" " >请选择</option>
	     #foreach ($degree in $map.degree)
	        <option value="${degree.id}" #if($degree.id == $map.expert.degree_id)  selected="selected" #end> ${degree.name}</option>
		  #end 
	</select><br/>
	联系电话：<input name="phone" value="${map.expert.phone}"><br/>
	状态：<input id="z1" type="radio" value="0" name="status" #if($map.expert.status ==0) checked #end/>正常启用
		  <input id="z2" type="radio" value="1" name="status" #if($map.expert.status ==1) checked #end/>异常  <br/>
	推荐单位：
	<select id="recom_com_id" name="">
	     <option value=" " >请选择</option>
	     #foreach ($company in $map.company)
	        <option value="${company.id}" #if($company.id == $map.expert.recom_com_id)  selected="selected" #end> ${company.name}</option>
		  #end 
	</select><br/>
	<button id="save">保存 </button>
</div>